package com.example.demo.modules.customDefine.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.modules.customDefine.entity.UserType;
import com.example.demo.modules.customDefine.mapper.UserTypeMapper;
import com.example.demo.modules.customDefine.service.UserTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserTypeServiceImpl extends ServiceImpl<UserTypeMapper, UserType> implements UserTypeService {

    @Autowired
    private UserTypeMapper userTypeMapper;

    //查询所有
    @Override
    public List<UserType> listAll(QueryWrapper queryWrapper) {
        List<UserType> userTypes = this.list(queryWrapper);
        return userTypes;
    }

    //条件查询
        @Override
    public UserType listOne(Long id) {
        UserType userType = this.getById(id);
        return userType;
    }

    //保存
        @Override
    public int insert(UserType userType){
        return userTypeMapper.insert(userType);

    }

}
